package com.test.personalblogproject.pojo;



import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import lombok.Data;

import javax.validation.constraints.Pattern;
import java.util.Date;

@Data
public class User {
    @NotNull
    private Integer id;//主键ID
    private String username;//用户名
    @JsonIgnore//让springmvc把当前对象转换成json字符串的时候,忽略password,最终的json字符串中就没有password这个属性了
    private String password;//密码


    @NotEmpty
    @Pattern(regexp = "^\\S{1,10}$")
    private String nickname;//昵称


    @NotEmpty
    @Email
    private String email;//邮箱
    private String userPic;//用户头像地址

    private Date createTime;//创建时间
    private Date updateTime;//修改时间

}
